#include "ComFun.h"

int IsDataInArray(uint8_t data,const uint8_t *array,uint16_t array_size)
{
    int i;

    for(i=0;i<array_size;i++)
    {
        if(data == array[i])
        {
            return 1;
        }
    }
    return 0;
}

uint8_t CheckSum(const void *data, int len)
{
    uint8_t cs = 0;

    while (len-- > 0)
        cs += *((uint8_t *) data + len);
    return cs;
}
